#include "stdafx.h"
#include "MainWindow.h"
#include "SoftPhoneWrapper.h"

CMainWindow::CMainWindow()
{
}


CMainWindow::~CMainWindow()
{
}
LRESULT CMainWindow::OnCreate(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	//CreateControlEx();
	try{
		RECT rc;
		::GetClientRect(m_hWnd, &rc);
		rc.bottom -= 50;
		HWND hWnd=m_SPCWrapperWnd.Create(m_hWnd, &rc, NULL, WS_VISIBLE | WS_CHILD);		
		if (hWnd){
			return TRUE;
		}
		else{
			return FALSE;
		}		
	}
	catch (...)
	{
		return FALSE;
	}
}

LRESULT CMainWindow::OnDestory(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	//CreateControlEx();
	m_SPCWrapperWnd.DestoryWindow();
	
	PostQuitMessage(0);
	return TRUE;
}